/******************************************************************************
 *                  Shanghai ChipON Micro-Electronic Co.,Ltd
 ******************************************************************************
 *  @File Name        : kf8a100fxx_amp.h
 *  @Author           : ChipON AE/FAE Group
 *  @Date             : 2023-12-19
 *  @HW Version       : KF8A100Fxx
 *  @Lib Version      : V2.0.1
 *  @Description      : This file provides the driver for the amp module
 ******************************************************************************
 *  Copyright (C) by Shanghai ChipON Micro-Electronic Co.,Ltd
 *  All rights reserved.
 *
 *  This software is copyright protected and proprietary to
 *  Shanghai ChipON Micro-Electronic Co.,Ltd.
 *****************************************************************************/
/******************************************************************************
 *  |Date        |Version  |Author       |Description
 ******************************************************************************
 *  |2023-12-23  |V2.0     |Xiong Yichao |New creat
 *****************************************************************************/

#ifndef KF8A100FXX_AMP_H
#define KF8A100FXX_AMP_H

#ifdef __cplusplus
extern "C" {
#endif

/******************************************************************************
 *                      Include Files
 *****************************************************************************/
#include "kf8a100fxx.h"
/******************************************************************************
 *                      Macro or Inline
 *****************************************************************************/

/**
 * @brief amp module disable/enable
 * 0: disable, 1:enable
 *
 */
#define AMP_ENABLE(x) (AMPON = (x))
/*****************************************************************************
 *                      Typedef Definitions
 *****************************************************************************/
/**
 * @brief AMP INPS select
 */
typedef enum
{
    AMPINPS_P22 = 0u,
    AMPINPS_P23 = 16u,
    AMPINPS_P15 = 32u,
    AMPINPS_GND = 48u
} Amp_InpsType;

/**
 * @brief AMPCAL enabled
 */
typedef enum
{
    AMPCAL_DISABLE,
    AMPCAL_ENABLE
} Amp_CalEnType;

/**
 * @brief AMP enabled
 */
typedef enum
{
    AMPON_DISABLE,
    AMPON_ENABLE
} Amp_OnType;

/******************************************************************************
 *                      Export Variables
 *****************************************************************************/

/******************************************************************************
 *                      Export Functions
 *****************************************************************************/

/**
 * @brief AMP initialization
 * 1. the op-amp outputs should also be set to analog inputs;
 * 2. the op-amps are forced off and cannot be used in hibernation mode.
 *
 * @param InpsSeclect AMP positive seclect
 */
void Amp_Init(Amp_InpsType InpsSeclect);

/**
 * @brief AMP Deinitialization
 *
 */
void Amp_DeInit(void);
/**
 * @brief AMP Calibrate enable bit
 *
 * @param Cal disable/enable
 */
void Amp_CalEn(Amp_CalEnType Cal);

/**
 * @brief AMP enable bit
 *
 * @param On disable/enable
 */
void Amp_On(Amp_OnType On);

/**
 * @brief AMP Calibrate
 *
 */
void Amp_Calibrate(void);

#ifdef __cplusplus
}
#endif
/* EOF */
#endif
